package com.dinzeer.resonantisshelomoh.event;

import com.dinzeer.resonantisshelomoh.Resonantisshelomoh;
import mods.flammpfeil.slashblade.event.SlashBladeEvent;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.Items;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;

@Mod.EventBusSubscriber
public class StandOnHit {
    @SubscribeEvent
    public static void BladeStandOnHit(SlashBladeEvent.BladeStandAttackEvent  event){
      if (event.getDamageSource().getDirectEntity() instanceof Player player){
          if (event.getSlashBladeState().getTranslationKey().equals(  "item.resonantisshelomoh.reversed")){
              if (player.getMainHandItem().getItem() == Items.BLACK_DYE){
                  event.getSlashBladeState().setTranslationKey("item.resonantisshelomoh.reversed_black");
                  event.getSlashBladeState().setTexture(Resonantisshelomoh.prefix("model/speed/speed_2.png"));
              }
          }
      }
    }
}
